<!DOCTYPE html>
<html>
<body onload="runTests();">
<script src="../../resources/dump-as-markup.js"></script>
<div id="test1" contenteditable><strong>hello</strong> <img src="../resources/abe.png"> world</div>
<div id="test2" contenteditable><img src="../resources/abe.png"></div>
<script>

function runTests() {
    Markup.description('This tests RemoveFormant command not removing an image.  You should see one image element in each of the test results');
    window.getSelection().selectAllChildren(document.getElementById('test1'));
    document.execCommand('RemoveFormat', false, null);
    Markup.dump('test1', 'An image between text');

    window.getSelection().selectAllChildren(document.getElementById('test2'));
    document.execCommand('RemoveFormat', false, null);
    document.execCommand('JustifyNone', false, null);
    document.execCommand('FormatBlock', false, 'p');
    Markup.dump('test2', 'RemoveFormat on an image followed by JustifyNone and FormatBlock with p.');

    Markup.notifyDone();
}

Markup.waitUntilDone();

</script>
</body>
</html>
